<%@page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<html>
<head>
<style type="text/css">
<%@include file="../stylesheets/progresbar.css"%>
 <%@ include file="../stylesheets/main.css"%> 
<%@ include file="../stylesheets/header.css"%>
<%@ include file="../stylesheets/footer.css"%>
 <%@ include file="../stylesheets/indexContent.css"%>
<%@ include file="../stylesheets/carousel.css"%> 
</style>

<title>Zamówienia</title>
</head>

<body>
	<div id="left-column-outer">
		<div id="left-column"></div>
	</div>
	<div id="center-column">
		<div class="CenteredContainer">
			<img id="background_noresize" alt="background_noresize"
				src="<%=request.getContextPath()%>/img/background.jpg" />
			<%@ include file="header.jsp"%>
			<div class="ContentShade">
			
		<div style="height:300px; overflow:auto">	
				<table><caption align="TOP">Produkcja - zamówienia</caption>
					<tr>
						<th>Id </th>
						<th>Data</th><th>Produkt</th>
						<th>Liczba</th>
						
						<th>Stan Realizacji</th>
					</tr>

					<c:forEach items="${productOrders}" var="p"
						varStatus="loop">
						<tr align="center">
						<td width="400">${p.productionID }</td>
						
						<td width="200"><fmt:formatDate value="${p.date }" type="both" 
      pattern="yyyy-MM-dd HH:mm" /></td>
						<td>${p.product.name }</td>
						<td>${p.amount }</td>
						
						<td>
						<c:if test="${p.realization }">
							Zrealizowano
						</c:if>
						<c:if test="${!p.realization }">
							Niezrealizowano
						</c:if>						
						
						
						
						</td>
					</c:forEach>
	
				</table>
</div>
<div style="height:300px; overflow:auto">	
<table >

<caption align="TOP"> Składniki zamówienia</caption>
	<tr>
						<th>Id </th>
						<th>Data</th>
						<th>Nazwa</th>
					<th>Liczba</th>
						<th>Stan Zamówienia</th>
						
					</tr>
					<c:forEach items="${ingredientsOrders}" var="p"
						varStatus="loop">
					<tr align="center">
					<td width="400">${p.orderId}</td>
					<td width="200" align="CENTER"><fmt:formatDate value="${p.date }" type="both" 
      pattern="yyyy-MM-dd HH:mm" /></td>
					
				
					<c:forEach items="${p.ingredientOrderInfo }" var="i" varStatus="loop">
					<td>${i.ingredient.name}</td>
					<td>${i.amount}</td>
					
					</c:forEach>
									
					 <td align="CENTER">${p.orderStatus}</td>
					</tr>
</c:forEach>
</table>
</div>
				<%@ include file="footer.jsp"%>
			</div>
		</div>
	</div>
	<div id="right-column-outer">
		<div id="right-column"></div>
	</div>

</body>